package com.mobeedom.android.justinstalled.db;

import android.database.Cursor;
import android.database.CursorWrapper;

public class ORMCursorsWrapper extends CursorWrapper {

	protected String idColumnName = "id";
	
	public ORMCursorsWrapper(Cursor cursor) {
		super(cursor);
	}

	public ORMCursorsWrapper(String idColumnName, Cursor cursor) {
		super(cursor);
		this.idColumnName = idColumnName;
	}

	@Override
	public int getColumnIndexOrThrow(String columnName) throws IllegalArgumentException {
		if(columnName.compareToIgnoreCase("_id") == 0)
			columnName = idColumnName;
		return super.getColumnIndexOrThrow(columnName);
	}
}
